const Koa = require("koa");

const Router = require("koa-router");
const userRouter = require("./router/user");

userRouter.get("/:id", (ctx, next) => {
  console.log(ctx.request.params);
  console.log(ctx.request.query);
});

const app = new Koa();

// app.use((ctx, next) => {
//   console.log(ctx.url);
//   console.log(ctx.query);
//   console.log(ctx.params);
//   ctx.response.body = "Hello World";
// });

app.use(userRouter.routes());

app.listen(8000, () => {
  console.log("参数解析服务器启动成功");
});
